home *** CD-ROM | disk | FTP | other *** search
- function SetCurrentIndexLetter(letter)
- {
- parent.gCurIndexLetter=letter;
- }
-
- //-------------------------------------------------------------------------------
- // PLNOTE: if useCache=TRUE then links will be generated to point to CACHE_ files...
- function DrawIndexHeader(useCache)
- {
- var astr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- var i;
-
- document.writeln('<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">');
- document.writeln('<TR><TD><DIV CLASS="IndexLookup"><FONT SIZE=4>');
-
- if (useCache)
- {
- for (i=0;i<26;i++)
- {
- ref = "CACHE_Index_" + astr.charAt(i) + ".htm";
- document.writeln('<a href="' + ref + '" target="contents">' + astr.charAt(i) + '</a>');
- }
- }
- else
- {
- for (i=0;i<26;i++)
- {
- document.writeln('<a href="Index.htm" onClick="JavaScript:SetCurrentIndexLetter(\''+ astr.charAt(i) +'\');" target="contents">' + astr.charAt(i) + '</a>');
- }
- }
-
- document.writeln('</FONT></DIV></TD></TR>');
- document.writeln('</TABLE>');
-
- document.writeln('</table>\n</center>');
- }
-
-
- //-------------------------------------------------------------------------------
- var gIndex = new Array;
- var gNumIndex=0;
- var gPagePrefix="Guide_";
-
- function IndexItem(depth, name, link1, link2, link3)
- {
- this.depth = depth;
- this.name = name;
- this.link1 = link1;
- this.link2 = link2;
- this.link3 = link3;
- }
-
- function IndexAdd(depth, name, link1, link2, link3)
- {
- gIndex[gNumIndex]=new IndexItem(depth, name, link1, link2, link3);
-
- gNumIndex++;
- }
-
- // Writes index to file
- function WriteIndexToCache(destFP)
- {
- var i;
-
- for (i=0;i<gNumIndex;i++)
- {
- if (gIndex[i].depth>0)
- {
- destFP.WriteLine('<DIV> ');
- }
- else
- {
- destFP.WriteLine('<DIV>');
- }
-
- destFP.WriteLine(gIndex[i].name);
-
- if (gIndex[i].link1)
- destFP.WriteLine(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link1 + '); return false;"><img src="img/ix1.gif" border=0 alt="Page #' + gIndex[i].link1 + '"></a>');
- if (gIndex[i].link2)
- destFP.WriteLine(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link2 + '); return false;"><img src="img/ix2.gif" border=0 alt="Page #' + gIndex[i].link2 + '"></a>');
- if (gIndex[i].link3)
- destFP.WriteLine(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link3 + '); return false;"><img src="img/ix3.gif" border=0 alt="Page #' + gIndex[i].link3 + '"></a>');
-
- destFP.WriteLine('</DIV>');
- }
- }
-
- // Displays index to screen
- function DisplayIndex()
- {
- var i;
- var statusCnt=0, statusStep;
- var statusStr="Working";
-
- statusStep = Math.ceil(gNumIndex/10);
-
- for (i=0;i<gNumIndex;i++)
- {
- // DISPLAY STATUS...
- if(!statusCnt)
- {
- statusStr+=".";
- window.status=statusStr;
- }
- statusCnt=(statusCnt+1)%statusStep;
-
- if (gIndex[i].depth>0)
- {
- document.writeln('<DIV> ');
- }
- else
- {
- document.writeln('<DIV>');
- }
-
- document.writeln(gIndex[i].name);
-
- if (gIndex[i].link1)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link1 + '); return false;"><img src="img/ix1.gif" border=0 alt="Page #' + gIndex[i].link1 + '"></a>');
- if (gIndex[i].link2)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link2 + '); return false;"><img src="img/ix2.gif" border=0 alt="Page #' + gIndex[i].link2 + '"></a>');
- if (gIndex[i].link3)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + gIndex[i].link3 + '); return false;"><img src="img/ix3.gif" border=0 alt="Page #' + gIndex[i].link3 + '"></a>');
-
- document.writeln('</DIV>');
- }
-
- window.status="";
- }
-
-
- function DrawIndexItem(indexItem, lastItem)
- {
- document.writeln('<DIV>');
- if (indexItem.depth>0)
- {
- document.writeln(lastItem + ": " + indexItem.name);
- }
- else
- {
- document.writeln(indexItem.name);
- }
-
-
- if (indexItem.link1)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + indexItem.link1 + '); return false;"><img src="img/ix1.gif" border=0 alt="Page #' + indexItem.link1 + '"></a>');
-
- if (indexItem.link2)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + indexItem.link2 + '); return false;"><img src="img/ix2.gif" border=0 alt="Page #' + indexItem.link2 + '"></a>');
-
- if (indexItem.link3)
- document.writeln(' <a href="#" onClick="JavaScript:parent.nav.openPageAbs(' + indexItem.link3 + '); return false;"><img src="img/ix3.gif" border=0 alt="Page #' + indexItem.link3 + '"></a>');
-
- document.writeln('</DIV>');
- }
-
- function PrepKey(s)
- {
- s = s.toLowerCase();
- s = s.replace(/(,|-|;|%..|\.|\?|\\|\/|\[|\]|\{|\}|\(|\)|\+|\*|\|)/g, " ");
-
- return s;
- }
-
-
-
- function DoSearch(key, exactMatch)
- {
- var i, words;
- var lastItem;
- var lkey, ltest;
- var found=false;
- var keyList;
- var maxItemsToFind = 100;
- var statusCnt=0;
- var searchString = "Searching";
-
- //PLTEST: document.writeln("ORIG KEY: " + key + "<BR>");
-
- // Format key - eliminate special chars and replace spaces with +
- lkey = PrepKey(key);
-
- lkey=lkey.replace(/(\s+|\++)+/g, "+");
-
- //PLTEST: document.writeln("NEW KEY: " + lkey + "<BR>");
-
- keyList = lkey.split("+");
-
- if (exactMatch)
- {
- for (i=0;i<keyList.length;i++)
- {
- keyList[i]=new RegExp("(^| )" + keyList[i] + "( |$)");
- }
- }
- else
- {
- // strip common suffixes off of key
- for (i=0;i<keyList.length;i++)
- {
- var len = keyList[i].length;
-
- keyList[i] = keyList[i].replace(/(.*....)(ing$|s$|ed$|or$)/, "$1");
- }
- }
-
-
- if (keyList.length == 1)
- {
- // PLNOTE: optimized for single word...
- for (i=0;i<gNumIndex;i++)
- {
- // DISPLAY STATUS...
- if(!statusCnt)
- {
- searchString+=".";
- window.status=searchString;
- }
- statusCnt=(statusCnt+1)%250;
-
-
- if (gIndex[i].depth==0)
- lastItem=gIndex[i].name;
-
- ltest = PrepKey(gIndex[i].name); //.toLowerCase();
-
- if (!exactMatch)
- {
- ltest = ltest.replace(/(.*....)(ing\b|s\b|ed\b|or\b)/g, "$1"); // strip common suffixes off of key
- }
-
- // PLNOTE: searches in both directions to maximize substring find!!
- if (gIndex[i].link1 && (ltest.search(keyList[0])>=0 || (!exactMatch && keyList[0].search(ltest)>=0) ) )
- {
- found = true;
-
- DrawIndexItem(gIndex[i], lastItem);
-
- if (--maxItemsToFind <= 0)
- break;
- }
- }
-
- // Do 1 last check - check if key is a page number of if so goto that page...
- var pageNum = parseInt(keyList[0]);
- if (pageNum >= parent.nav.gFirstPage && pageNum <= parent.nav.gLastPage)
- {
- var tempItem = new IndexItem(0, "Help Page: "+pageNum, pageNum);
- DrawIndexItem(tempItem, 0);
- found=true;
- }
- }
- else
- {
- var matchAll;
-
- for (i=0;i<gNumIndex;i++)
- {
- // DISPLAY STATUS...
- if(!statusCnt)
- {
- searchString+=".";
- window.status=searchString;
- }
- statusCnt=(statusCnt+1)%250;
-
- if (gIndex[i].depth==0)
- lastItem=gIndex[i].name;
-
- ltest = PrepKey(gIndex[i].name); //.toLowerCase();
-
- if (!exactMatch)
- ltest = ltest.replace(/(.*....)(ing\b|s\b|ed\b|or\b)/g, "$1"); // strip common suffixes off of key
-
- matchAll=true;
-
- for (words=0;words<keyList.length;words++)
- {
- lkey = keyList[words];
-
- // PLNOTE: searches in both directions to maximize substring find!!
- if (gIndex[i].link1 && (ltest.search(lkey)>=0 || (!exactMatch && lkey.search(ltest)>=0) ) )
- {
- // found - continue on...
- }
- else
- {
- if (!lastItem || lastItem.search(lkey)<0) // Also check lastItem
- {
- matchAll=false;
- break;
- }
- }
- }
-
- if (matchAll)
- {
- found = true;
-
- DrawIndexItem(gIndex[i], lastItem);
-
- if (--maxItemsToFind <= 0)
- break;
- }
- }
- }
-
- if (!found)
- {
- document.writeln('Nothing Found...');
- }
-
- window.status="";
- }
-
-
- function BuildIndex_All()
- {
- var astr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- var cmd;
-
- for (i=0;i<26;i++)
- {
- cmd = "BuildIndex_" + astr.charAt(i) + "();";
- eval(cmd);
- }
- }